package com.demo.component;

import com.demo.model.Student;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class StudentBeans {

    @Bean
    public Student student1() {
         Student stu = new Student();
         stu.setAge(18);
         stu.setId(111);
         stu.setName("Liming");
         return stu;
    }
    @Bean
    public Student student2() {
        Student stu = new Student();
        stu.setAge(21);
        stu.setId(111);
        stu.setName("王五");
        return stu;
    }
}
